<template>
  <!-- 商品评论 -->
  <div class="comment">
    <myheader>
      <template #left>
        <span @click="$router.back()">返回</span>
      </template>
    </myheader>
    <mycomment :name="this.$route.params.id">
      <template #top>
        <div class="top">{{ title }}</div></template
      >
    </mycomment>
  </div>
</template>

<script>
import { getGoodsDetial } from "@/apis/goods";
import myheader from "@/components/myheader";
import mycomment from "@/components/comment";
export default {
  components: { myheader, mycomment },
  data() {
    return {
      title: "",
    };
  },
  mounted() {
    // this.goodsId=this.$route.params.id
    getGoodsDetial(this.$route.params.id, { pageindex: 1 }).then((res) => {
      console.log(res);
      this.title = res.data.message[0].title;
    });
  },
};
</script>

<style lang="less" scoped>
.comment {
  margin-bottom: 50px;
}
.top {
  padding: 15px 0;
  color: #26a2ff;
}
</style>